import request from '@/utils/request'

export function listDict(data) {
  return request({
    url: '/api/base/dict/page',
    method: 'post',
    data
  })
}

export function saveDicts(data) {
  return request({
    url: '/api/base/dict/save_auto_code',
    method: 'post',
    data
  })
}
export function createFolder(data) {
  return request({
    url: '/api/eim/document_coa/create_folder',
    method: 'post',
    data
  })
}

export function saveDict(data) {
  return request({
    url: '/api/base/dict/save',
    method: 'post',
    data
  })
}

export function updateDict(data) {
  return request({
    url: '/api/base/dict/update',
    method: 'post',
    data
  })
}

/**
   * 修改文件夹名称
   * @data{
}
*/
export function updateDictName(data) {
  return request({
    url: 'api/base/dict/update_dict_name',
    method: 'post',
    data
  })
}

export function deleteDict(data) {
  return request({
    url: '/api/base/dict/delete',
    method: 'post',
    data
  })
}

export function getDictItem(data) {
  return request({
    url: '/api/base/dict/get_item',
    method: 'post',
    data
  })
}

export function listDictItem(data) {
  return request({
    url: '/api/base/dict/list_item',
    method: 'post',
    data
  })
}

export function listDictProperty(data) {
  return request({
    url: '/api/base/dict/list_dict_property',
    method: 'post',
    data
  })
}

export function listDictProperties(data) {
  return request({
    url: '/api/base/dict/list_dict_properties',
    method: 'post',
    data
  })
}

/**
 * 获取字典信息
 * @data{
  documentReleaseIds:number
}
 */
export function listDictTreeItem(data) {
  return request({
    url: '/api/base/dict/list_tree_item',
    method: 'post',
    data
  })
}

export function listDictTreeItemForManage(data) {
  return request({
    url: '/api/base/dict/list_tree_item_for_manage',
    method: 'post',
    data
  })
}

export function listDictGroupItem(data) {
  return request({
    url: '/api/base/dict/list_dict_group_item',
    method: 'post',
    data
  })
}

export function listDictGroupTriple(data) {
  return request({
    url: '/api/base/dict/list_dict_group_triple',
    method: 'post',
    data
  })
}

export function listDictGroupItemAll(data) {
  return request({
    url: '/api/base/dict/list_dict_group_item_all',
    method: 'post',
    data
  })
}



/**
 * 获取分类信息
 * @data{
  documentReleaseIds:number
}
 */
export function getListItem(data) {
  return request({
    url: '/api/base/dict/list_dict_group_item_by_group_code',
    method: 'post',
    data
  })
}


/**
 * 获取coa字典
 * @data{
  documentReleaseIds:number
}
 */
export function getListTreeItem(data) {
  return request({
    url: '/api/base/dict/list_tree_item',
    method: 'post',
    data
  })
}


/**
 * 获取配置字典
 * @data{
  documentReleaseIds:number
}
 */
export function lexicalList(data) {
  return request({
    url: '/api/base/dict/list',
    method: 'post',
    data
  })
}



/**
 * 删除coa配置字典
 * @data{
  documentReleaseIds:number
}
 */
export function LexicalDelete(data) {
  return request({
    url: '/api/base/dict/delete',
    method: 'post',
    data
  })
}



/**
 * 获取流程默认处理人 "dictGroupCode":"flow_default_handle_user",
  "dictCode":"draft",流程节点
  "parentDictCode":"1"流程类型
}
 */
export function listItemByParent(data) {
  return request({
    url: '/api/base/dict/list_item_by_parent',
    method: 'post',
    data
  })
}






